﻿using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;

namespace SPXsltWs.SPXsltWsWebpart
{
    [ToolboxItemAttribute(false)]
    public class SPXsltWsWebpart : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/SPXsltWs/SPXsltWsWebpart/SPXsltWsWebpartUserControl.ascx";
        private string _serviceurl;

        protected override void CreateChildControls()
        {
            SPXsltWsWebpartUserControl control = Page.LoadControl(_ascxPath) as SPXsltWsWebpartUserControl;
            if (control != null) control.WebPart = this;
            Controls.Add(control);
        }

        [WebBrowsable(true),
        WebDisplayName("Webservice Url"),
        WebDescription(""),
        Personalizable(
        PersonalizationScope.Shared),
        Category("Settings"),
        DefaultValue("")]
        public string WebServiceUrl
        {
            get;
            set;
        }

        [WebBrowsable(true),
        WebDisplayName("Soap Action"),
        WebDescription(""),
        Personalizable(
        PersonalizationScope.Shared),
        Category("Settings"),
        DefaultValue("")]
        public string SoapAction
        {
            get;
            set;
        }

        [WebBrowsable(true),
        WebDisplayName("Soap Body"),
        WebDescription(""),
        Personalizable(
        PersonalizationScope.Shared),
        Category("Settings"),
        DefaultValue("")]
        public string SoapBody
        {
            get;
            set;
        }

        [WebBrowsable(true),
        WebDisplayName("XSLT Definition"),
        WebDescription(""),
        Personalizable(
        PersonalizationScope.Shared),
        Category("Settings"),
        DefaultValue("")]
        public string Xslt
        {
            get { return _serviceurl; }
            set {
                _serviceurl = value;
            }
        }
    }
}
